<?php
/**
 * 说说挂件
 * 使用方法
 * {:W('Say',array(tpl'=>'index',listRows=>'5'))}
 * @author 林吉 <317365887@qq.com>
 */
class SayWidget extends Widget {
    public function render($data) 
    {
        $data['listRows']=isset($data['listRows'])?$data['listRows']:5;
        $data['tpl']=isset($data['tpl'])?$data['tpl']:'index';
        $say=M('Say');
        $where['status']=1;
        $data['data']=$say->field('id,title,content')->where($where)->order('id DESC')->select();
        $html = $this->renderFile($data['tpl'],$data);
        return $html;
    }
}
?>